The DirectX 10 Pipeline:
Before we go any further, it’s probably wise to have a look at how Microsoft has laid out the DirectX 10 pipeline. It’s very different from the traditional graphics pipeline, as the shader portion is now completely unified. Instead of an instruction making its way through the vertex shader and then moving on to the pixel shader, instructions are recognised in the input assembler which then forwards the instruction onto the shaders.
Microsoft felt that it was time to move away from the traditional fixed function graphics pipeline we have become accustomed to. Thankfully, NVIDIA has already made that move with the GeForce 8800 series, while ATI publicly stated that it would be developing its second unified shader architecture (the first being the GPU inside Xbox 360) for its
next-generation R600 graphics processor. Although it’s possible to implement DirectX 10 with a traditional GPU design, there would be little to no advantage in doing so. When it comes to efficiency, a traditional fixed-function GPU design would have a lot of idle silicon in all but the perfect development scenario.
Input Assembler and Vertex Shader:
The Input Assembler (IA) is where all data enters the graphics pipeline – it collects one-dimensional vertex data from the input streams that are attached to the vertex buffers (up to eight are allowed) and then converts this data into an FP32 data format. Once this is complete, the IA specifies an independent vertex structure with up to 16 elements. Then, a vertex is assembled by reading from the currently enabled streams in the IA. Vertexes become the shapes that are rendered on-screen.
The IA also supports instancing across all portions of the shader pipeline, meaning that it can replicate an object many times over with only one draw call. To an extent, this was possible with DirectX 9, but each instance of the object was essentially a clone of the primary object. You couldn’t use different textures or shaders on the instanced objects, making environments look incredibly uniform – think of the forests of endlessly identical trees in Elder Scrolls IV: Oblivion, a game which used instancing quite heavily. Thankfully, these are liberated in the DirectX 10 pipeline with the introduction of texture arrays and support for switch statements in HLSL10 (higher level shader language). This should make for better environments that are more varied.
Texture arrays allow the developer to store up to 512 textures in an array, while up to 128 of the textures stored in any one array can be bound to a single shader. The maximum texture resolution has been increased too; it’s up to 8192x8192 from 4096x4096. This will be a boon for developers like ID software, who are keen to make use of megatextures in games (the first being the forthcoming Quake Wars: Enemy Territory).
It’s possible for the shader programme to dynamically index textures into an array. Texture arrays are a great thing, as it helps to remove state change overhead when texturing since it’s now possible to multi-texture on the GPU without needing to use the CPU. Using DirectX 10, it is possible to apply different textures in the array to different instances of the same object, thus making them look different – this is going to help make things like forests of trees more realistic and believable.
Click to enlarge HLSL10’s support for switch statements means that it’s possible to create a complex shader programme that describes many different materials and effects. For example, if you were rendering a forest of trees, each tree can use the same complex shader programme to apply different effects and materials onto the instanced objects. In conjunction with the capabilities of texture arrays, this is obviously going to make forests look a lot more realistic and much less uniform – the same can be said for other objects too.
The Vertex Shader is fairly self explanatory, since it’s something we’ve become accustomed to in a traditional graphics pipeline. However, with the DirectX 10 pipeline, you can now access up to 128 texture buffers and 16 constant buffers in each different stage of the shader pipeline – this is because all stages of the shader pipeline use the same shader processors and thus have the same functionality (providing a unified architecture is implemented at the hardware level).
Now that we’ve covered some of the changes, let’s move on to some of the completely new additions in the DirectX 10 pipeline...
Want to comment? Please log in.